using System;
using System.Collections.Generic;
using System.Text;
using Deepcode.Flux.Core.Extensions;

namespace Deepcode.Flux.Core.Systems.Asset
{
	public class AssetFilters
	{
		/// <summary>
		/// Cache members
		/// </summary>
		private AssetFilter [] _AllFilterCache = null;

		/// <summary>
		/// Gets all of the filters associated with this installation
		/// </summary>
		/// <returns></returns>
		public AssetFilter [] GetAllFilters()
		{
			if( _AllFilterCache != null ) return _AllFilterCache;

			AddinTreeNode r = AddinTree.Tree.GetTreeNodeNoThrow("/Flux/Asset/Filters/");
			if( r == null ) return new AssetFilter[0];

			_AllFilterCache = r.BuildChildItems(null).ToArray(typeof( AssetFilter )) as AssetFilter [];
			return _AllFilterCache;
		}
	}
}
